﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

namespace FireBillBook.DbMigrations
{
    public class LocalPgsqlContextFactory : IDesignTimeDbContextFactory<LocalPgSqlContext>
    {
        private const string DevConnectionString = "Host=127.0.0.1;Database=billingbook;Username=postgres;Password=123456";

        public LocalPgSqlContext CreateDbContext(string[] args)
        {
            var builder = new DbContextOptionsBuilder<LocalPgSqlContext>()
                .UseNpgsql(DevConnectionString);
            return new LocalPgSqlContext(builder.Options);
        }
    }
}
